<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>国际化语言管理系统 - 管理后台</title>
    <link href="/css/bootstrap.min.css" rel="stylesheet">
    <link href="/css/bootstrap-icons.css" rel="stylesheet">
    <style>
        body {
            background: #f5f5f5;
        }
        .sidebar {
            position: fixed;
            top: 56px;
            left: 0;
            bottom: 0;
            width: 240px;
            background: #f8f9fa;
            z-index: 100;
            box-shadow: inset -1px 0 0 rgba(0,0,0,.08);
            border-right: 1px solid #e0e0e0;
            padding-top: 1rem;
            min-height: calc(100vh - 56px);
        }
        .main-iframe {
            position: absolute;
            top: 56px;
            left: 240px;
            right: 0;
            bottom: 0;
            width: calc(100% - 240px);
            height: calc(100vh - 56px);
            border: none;
            background: #fff;
        }
    </style>
</head>
<body>
    <!-- 顶部导航栏 -->
    <nav class="navbar navbar-expand-lg navbar-light bg-white fixed-top">
        <div class="container-fluid">
            <a class="navbar-brand" href="#">国际化语言管理系统</a>
        </div>
    </nav>
    <!-- 左侧菜单 -->
    <div th:replace="admin/translate/menu :: menu(activePage='index')"></div>
    <!-- 右侧内容区iframe -->
    <iframe id="mainContent" class="main-iframe" src="/admin/translate/index" frameborder="0"></iframe>
    <script>
    document.addEventListener('DOMContentLoaded', function() {
        var sidebarMenu = document.getElementById('sidebarMenu');
        var iframe = document.getElementById('mainContent');
        if (sidebarMenu && iframe) {
            sidebarMenu.addEventListener('click', function(e) {
                var target = e.target;
                // 兼容点击图标
                if (target.tagName !== 'A') {
                    target = target.closest('a');
                }
                if (target && target.hasAttribute('data-href')) {
                    e.preventDefault();
                    var href = target.getAttribute('data-href');
                    iframe.src = href;
                    // 菜单高亮
                    sidebarMenu.querySelectorAll('.nav-link').forEach(function(link) {
                        link.classList.remove('active');
                    });
                    target.classList.add('active');
                }
            });
        }
    });
    </script>
</body>
</html> 